<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue</title>
<script src="../node_modules/jquery/dist/jquery.min.js"></script>
</head>
<style>
  
</style>



<body>

            
      <input type="button" value="获取数据" id="but">
    
            <script>
                        $(function(){
                            $("#but").click(function(){
                                    $.ajax({
                                          url:'./data.json',
                                          type:'get', 
                                          data: '',
                                          dataType: 'json',
                                          // success: result =>{ alert(result.message) }


                                    }).then(
                                          function(data){
                                                alert(data.sex);
                                          }
                                    )
                            });
                        });
            </script>
 
      </body>
    
</html>